package com.koro.controller;

import com.koro.entity.Users;
import com.koro.service.UsersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "用户登陆")
public class LoginController {

    @Autowired
    private UsersService usersService;

    // @CrossOrigin(origins = "http://localhost:8080/")
    @ApiModelProperty(value = "用户登陆",notes = "用户登陆")
    @PostMapping("/login")
    public String login(@RequestBody Users users) {
        System.out.println("开始执行controller");
        return usersService.login(users);
    }
}
